package collection;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

public class SortPoint {
    public static void main(String[] args) {

        List<Point> points = new ArrayList<Point>();
        points.add(new Point(1,2));
        points.add(new Point(1,3));
        points.add(new Point(1,4));
        points.add(new Point(1,5));
        points.add(new Point(1,6));
        points.add(new Point(1,7));

        System.out.println(points);


        Collections.sort(points, ( o1,  o2) -> o1.getY()-o2.getY());

    }
}
